import json
import requests
# 定义请求url和传入的data
# url = "http://127.0.0.1:9999/demo_test/hello/"
# # 向服务发送get请求
# res = requests.get(url)
# print(res.text)

 # 发送post请求
url1 = "http://127.0.0.1:9999/demo_test/answer/"
data = {"text1": 2}
response = requests.post(url1, json=data)
print(response)
if response.status_code == 200:
    result = response.json()
    print("Response:", result)
else:
    print("Error:", response.status_code)
